/**
 * Copyright 1993-2018 Agree Tech.
 * All rights reserved.
 */
package com.fjl.pojo;

import com.fjl.exception.AbpmServiceException;
import com.fjl.result.AbpmServiceResults;

import java.util.Collection;
import java.util.List;

/**
 * 服务结果
 * @author PuYun pu.yun@agree.com.cn
 */
public class ServiceResult
{

    private String businessKey;

    private String definitionCaption;

    private String definitionKey;

    private boolean ended;

    private List<String> pathTaskKeyList;

    private List<String> pathTaskNameList;

    private String resultCode;

    private String resultDetail;

    private String resultMessage;

    private String rootProcessInstanceId;

    private String taskExecutionId;

    private String taskId;

    private String taskKey;

    private String taskName;

    private String taskProcessInstanceId;
    
    private Collection<FormInfo> formInfoList;

    private List<String> conditionExprList;

    /**
     * @param exception
     */
    public void exception(AbpmServiceException exception)
    {
        this.resultCode = exception.getCode();
        this.resultMessage = exception.getMessage();
        this.resultDetail = exception.getDetail();
    }
    
    public void exception(AbpmServiceResults callResult)
    {
        this.resultCode = callResult.getCode();
        this.resultMessage = callResult.getMessage();
    }
    
    public void exception(AbpmServiceResults callResult, String detail)
    {
        this.resultCode = callResult.getCode();
        this.resultMessage = callResult.getMessage();
        this.resultDetail = detail;
    }

    /**
     * @return the businessKey
     */
    public String getBusinessKey()
    {
        return businessKey;
    }

    /**
     * @return the definitionCaption
     */
    public String getDefinitionCaption()
    {
        return definitionCaption;
    }

    /**
     * @return the definitionKey
     */
    public String getDefinitionKey()
    {
        return definitionKey;
    }

    /**
     * @return the pathTaskKeyList
     */
    public List<String> getPathTaskKeyList()
    {
        return pathTaskKeyList;
    }

    /**
     * @return the pathTaskNameList
     */
    public List<String> getPathTaskNameList()
    {
        return pathTaskNameList;
    }

    /**
     * @return the resultCode
     */
    public String getResultCode()
    {
        return resultCode;
    }

    /**
     * @return the resultDetail
     */
    public String getResultDetail()
    {
        return resultDetail;
    }

    /**
     * @return the resultMessage
     */
    public String getResultMessage()
    {
        return resultMessage;
    }

    /**
     * @return the rootProcessInstanceId
     */
    public String getRootProcessInstanceId()
    {
        return rootProcessInstanceId;
    }

    /**
     * @return the taskExecutionId
     */
    public String getTaskExecutionId()
    {
        return taskExecutionId;
    }

    public String getTaskId()
    {
        return taskId;
    }

    /**
     * @return the taskKey
     */
    public String getTaskKey()
    {
        return taskKey;
    }

    /**
     * @return the taskName
     */
    public String getTaskName()
    {
        return taskName;
    }

    /**
     * @return the taskProcessInstanceId
     */
    public String getTaskProcessInstanceId()
    {
        return taskProcessInstanceId;
    }

    public boolean isEnded()
    {
        return ended;
    }

    /**
     * @param businessKey
     *            the businessKey to set
     */
    public void setBusinessKey(String businessKey)
    {
        this.businessKey = businessKey;
    }

    /**
     * @param definitionCaption
     *            the definitionCaption to set
     */
    public void setDefinitionCaption(String definitionCaption)
    {
        this.definitionCaption = definitionCaption;
    }

    /**
     * @param definitionKey
     *            the definitionKey to set
     */
    public void setDefinitionKey(String definitionKey)
    {
        this.definitionKey = definitionKey;
    }

    public void setEnded(boolean ended)
    {
        this.ended = ended;
    }

    /**
     * @param pathTaskKeyList
     *            the pathTaskKeyList to set
     */
    public void setPathTaskKeyList(List<String> pathTaskKeyList)
    {
        this.pathTaskKeyList = pathTaskKeyList;
    }

    /**
     * @param pathTaskNameList
     *            the pathTaskNameList to set
     */
    public void setPathTaskNameList(List<String> pathTaskNameList)
    {
        this.pathTaskNameList = pathTaskNameList;
    }

    /**
     * @param resultCode
     *            the resultCode to set
     */
    public void setResultCode(String resultCode)
    {
        this.resultCode = resultCode;
    }

    /**
     * @param resultDetail the resultDetail to set
     */
    public void setResultDetail(String resultDetail)
    {
        this.resultDetail = resultDetail;
    }

    /**
     * @param resultMessage
     *            the resultMessage to set
     */
    public void setResultMessage(String resultMessage)
    {
        this.resultMessage = resultMessage;
    }

    /**
     * @param rootProcessInstanceId
     *            the rootProcessInstanceId to set
     */
    public void setRootProcessInstanceId(String rootProcessInstanceId)
    {
        this.rootProcessInstanceId = rootProcessInstanceId;
    }

    /**
     * @param taskExecutionId
     *            the taskExecutionId to set
     */
    public void setTaskExecutionId(String taskExecutionId)
    {
        this.taskExecutionId = taskExecutionId;
    }

    public void setTaskId(String taskId)
    {
        this.taskId = taskId;
    }

    /**
     * @param taskKey
     *            the taskKey to set
     */
    public void setTaskKey(String taskKey)
    {
        this.taskKey = taskKey;
    }

    /**
     * @param taskName
     *            the taskName to set
     */
    public void setTaskName(String taskName)
    {
        this.taskName = taskName;
    }

    /**
     * @param taskProcessInstanceId
     *            the taskProcessInstanceId to set
     */
    public void setTaskProcessInstanceId(String taskProcessInstanceId)
    {
        this.taskProcessInstanceId = taskProcessInstanceId;
    }

    public Collection<FormInfo> getFormInfoList()
    {
        return formInfoList;
    }

    public void setFormInfoList(Collection<FormInfo> formInfoList)
    {
        this.formInfoList = formInfoList;
    }

    public List<String> getConditionExprList() {
        return conditionExprList;
    }

    public void setConditionExprList(List<String> conditionExprList) {
        this.conditionExprList = conditionExprList;
    }
}
